Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when setting n_agents or n_objects to 0 #55

Closed
wants to merge 3 commits into from

Conversation

clement-moulin-frier
Copy link
Owner

Description

I went down the rabbit hole to try fixing #53 . I'm not sure it is the best solution but it seems to work, please have a look. @Marsolo1 Can you change the panel app so that it does not display the config types with 0 entities in the interface? (both in "Show configurations" as well as the "Selected", "Visualization configurations' and "State configurations". You can also take the occasion to remove the "s" in the two last ones). Let me know if not possible, in that case we will need to also take into account what to do if the Visualization configuration is modified (for now it breaks).

Related Issue (if applicable)

#53

How to Test

Launch the server (try with both --n_agents 0 and --n_objects 0)

python3 scripts/run_server.py

Launch the Panel interface

panel serve scripts/run_interface.py --autoreload

Check that everything works as expected (please do it extensively to be sure I haven't introduced a new bug). You can also check the changes in the code in case you see something that might cause future issues.

Screenshots (if applicable)

@Marsolo1
Copy link
Collaborator

I made so that the config columns don't appear if there is 0 of said entity type

@Marsolo1
Copy link
Collaborator

Check that everything works as expected (please do it extensively to be sure I haven't introduced a new bug). You can also check the changes in the code in case you see something that might cause future issues.

I can't make the server work with 0 agents and 0 objects at the same time, it raises an error.
0 agent and 1 object works, but with a jax warning, and 1 agent 0 object seems to work fine

Copy link
Collaborator

@corentinlger corentinlger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't dive into the visualization code a lot. Do you think there is an other way of preventing bugs than adding conditions to check if the configs aren't null ?

Otherwise I tested the PR and it indeed works fine for either 0 agent or 0 object (but not both at the same time, which is something that doesn't interest use anyway).

@corentinlger
Copy link
Collaborator

Check that everything works as expected (please do it extensively to be sure I haven't introduced a new bug). You can also check the changes in the code in case you see something that might cause future issues.

I can't make the server work with 0 agents and 0 objects at the same time, it raises an error. 0 agent and 1 object works, but with a jax warning, and 1 agent 0 object seems to work fine

I just had a question about the single agent. I tried to make it move by setting its behavior to Manual and changing the values of its wheels but it stood still. Is it normal ?

@corentinlger
Copy link
Collaborator

Actually we tested the simulation without objects and with either 1 or 2 agents with @Marsolo1.

There is a really strange thing happening. When you launch the server with only 1 agent, the interface stops updating well, and you can't for example change the behavior of the agent, change its proximeters range (but you get the info on the server side) ... But it works well with 2 agents.

Do you have an idea of where this could come from ?

@clement-moulin-frier
Copy link
Owner Author

I made so that the config columns don't appear if there is 0 of said entity type

Tested it but the Simulator tab no longer works

@corentinlger
Copy link
Collaborator

I close the pull request because we decided to re-do it (done by @Marsolo1 in #60).

@corentinlger corentinlger deleted the clement/fix-zero-entity branch April 29, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants